1. Field of the Invention
The present invention relates to a memory device and a memory card.
2. Description of the Related Art
Flash memories include NAND, NOR, and AND type memories. A SmartMedia is a kind of memory card using a NAND flash memory.
In a SmartMedia, errors may occur in data write processing or erase processing. To correct errors in a SmartMedia, ECC (Error Correction Code) is generally used. In the standard of a given SmartMedia, an error correction function with a 2-bit error detection capability and 1-bit error correction capability is used.
A flash memory has a function of indicating, by a status, whether a write or erase has normally been executed in write processing or erase processing. The status indicates only the presence/absence of errors and not the number of errors.
Document 1 (Jpn. Pat Appln. KOKAI Publication No. 5-282887, pp5, FIG. 6) discloses a memory device which makes a data block (memory block) unusable (form a bad block) when the status in write processing or erase processing indicates errors.
In the conventional SmartMedia, the number of errors generated in write processing or erase processing is not returned as a response to a write instruction or an erase instruction. Only a status representing the presence/absence of errors is returned. For this reason, it cannot be determined on the basis of the response to the write instruction or erase instruction whether the number of errors is a number correctable by the error correction function.
In the conventional SmartMedia, every time an error occurs in write processing or erase processing, a data block containing the error bit is set in the unusable state. For this reason, when unusable data blocks are accumulated, the usable capacity of the memory device in the SmartMedia decreases.